<template>
  <div class="layout">
    <!-- 歌单头部 -->
    <div class="playlist-head">
      <div class="list-bg" :style="`background-image:url(${src})`"></div>
      <div class="list-img">
        <img v-lazy="src" alt="Loading" />
      </div>
    </div>
    <!-- 返回按钮 -->
    <div @click="back" class="back">
      <img src="@/assets/img/ui/arrow_left.png" />
    </div>
    <!-- 歌单信息 -->
    <div class="playlist-info">
      <h3 class="playlist-name">{{ name }}</h3>
      <p class="artist">
        <span>{{ artist }}</span
        >
      </p>
    </div>
  </div>
</template>

<script>
export default {
  name: "playlist",
  data() {
    return {
      id: "",
      name: "",
      artist: "",
      src: "",
    };
  },
  methods: {
    // 返回上一页
    back() {
      this.$router.go(-1);
    },
  },
  created() {
    this.id = this.$route.query.id;
    this.name = this.$route.query.name;
    this.artist = this.$route.query.artist;
    this.src = this.$route.query.src;
  },
};
</script>

<style lang="scss" scoped>
.layout {
  height: 666px;
  overflow: hidden;
  color: white;
  // 歌单信息
  .playlist-head {
    width: 100%;
    height: 260px;
    position: relative;
    overflow: hidden;
    .list-bg {
      width: 1000%;
      height: 1000%;
      filter: blur(20px);
      position: absolute;
      top: -500px;
      left: -500px;
      z-index: 1;
    }
    .list-img {
      width: 200px;
      height: 200px;
      border-radius: 10px;
      overflow: hidden;
      margin: 30px auto 0;
      position: relative;
      z-index: 10;
      box-shadow: 0 0 10px 0px black;
      img {
        width: 100%;
        height: 100%;
      }
    }
  }
  .back {
    width: 28px;
    height: 28px;
    position: absolute;
    left: 20px;
    top: 28px;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: rgba(126, 126, 126, 0.6);
    z-index: 20;
    img {
      width: 68%;
    }
  }
  .playlist-info {
    padding: 10px 15px;
    overflow: hidden;
    // 歌手名字
    .playlist-name {
      width: 90%;
      font-size: 25px;
      margin-bottom: 20px;
      overflow: hidden;
    }
    .artist {
      margin-left: 15px;
      font-size: 12px;
      color: #ccc;
      span {
        font-size: 18px;
        margin-right: 5px;
        color: white;
      }
    }
  }
}
</style>